import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexLayout from "@/layout/IndexLayout";
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: "/",
        name: "IndexLayout",
        component: IndexLayout,
        children: [
            {
                path: "",
                name: "IndexPage",
                component: () => import("../views/Index/IndexPage.vue")
            },

        ]
    },
    //课程页面
    {
        path: '/ClassPage/:id',
        name: "ClassPage",
        component: () => import("../views/Index/components/ClassPage.vue")
    },
    //  搜索页面
    {
        path: '/SearchPage',
        name: 'SearchPage',
        component: () => import("../views/Search/SearchPage.vue")
    },

    //注册
    {
        path: '/registration',
        name: 'Registration',
        component: () => import("../views/user/components/Registration.vue")

    },
    //忘记密码
    {
        path: '/forgetThePassword',
        name: 'ForgetThePassword',
        component: () => import("../views/user/components/ForgetThePassword.vue")

    },
    //首页
    {
        path: '/indexPage',
        name: 'IndexPage',
        component: () => import("../views/Index/IndexPage.vue")

    },
    //首页顶部
    {
        path: '/titleComponent',
        name: 'TitleComponent',
        component: () => import("../views/Index/components/TitleComponent.vue")

    },

    //我的中心和订单
    {
        path: '/myMessageIndex',
        name: 'MyMessageIndex',
        component: () => import("../views/user/MyMessage/MyMessageIndex")
    },
    {
        path: '/IndexPaging',
        name: 'IndexPaging',
        component: () => import("../views/Index/IndexPaging")

    },

    //文章页面
    {
        path: '/ArticlePage',
        name:'ArticlePage',
        component: ()=>import("../views/Index/components/ArticlePage.vue")
    },
    //文章详情页
    {
        path: '/ArticleDetail',
        name:'ArticleDetail',
        component: ()=>import('../views/Index/components/ArticleDetail')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
